package com.platform.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.platform.dao.ApiSysMacroMapper;
import com.platform.entity.SysMacroVo;

/**
 * 通用字典表Service实现类
 *
 * @author czj
 * @email 729618941@qq.com
 * @date 2018-10-12 15:01:36
 */
@Service
public class ApiSysMacroService {
    @Autowired
    private ApiSysMacroMapper sysMacroDao;


    public SysMacroVo queryObject(Long id) {
        return sysMacroDao.queryObject(id);
    }

    public SysMacroVo queryByName(String name) {
        return sysMacroDao.queryByName(name);
    }

    public String queryValueByName(String name) {
        String value = null;
        SysMacroVo sysMacroVo = sysMacroDao.queryByName(name);
        if (sysMacroVo != null) {
            value= sysMacroVo.getValue();
        }
        return value;
    }


    public List<SysMacroVo> queryList(Map<String, Object> map) {
        return sysMacroDao.queryList(map);
    }


    public int queryTotal(Map<String, Object> map) {
        return sysMacroDao.queryTotal(map);
    }


    public int save(SysMacroVo sysMacro) {
        return sysMacroDao.save(sysMacro);
    }


    public int update(SysMacroVo sysMacro) {
        return sysMacroDao.update(sysMacro);
    }


    public int delete(Long id) {
        return sysMacroDao.delete(id);
    }


    public int deleteBatch(Long[] ids) {
        return sysMacroDao.deleteBatch(ids);
    }
}
